package com.starp.roomUtil;//package com.example.whatrubbish.db;

import androidx.room.TypeConverter;

import java.util.Date;

//import java.sql.Date;
//用 sql.Date 还是util.Date;


public class RoomConverter {
    @TypeConverter
    public static Date fromTimestamp(Long value) {
        return value == null ? null : new Date(value);
    }
    @TypeConverter
    public static Long dateToTimestamp(Date date) {
        return date == null ? null : date.getTime();
    }

}
